#ifndef TYPE_H
#define TYPE_H

#include <getch.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
//#include "md5.h"
#include <errno.h>
#include <time.h>
 
#define SHOP_MAX 1000  //商品种类最大数量
#define USER_MAX 1000      //用户最大数量 
#define LOGISTICS_MAX 30   //后勤人员最大数量
#define ADD_MIN  100       //报损数量
#define TIME_MAX 1000      //日志最大数量


#ifndef bool
typedef enum {
	false,
	true
} bool;
#endif


//管理员信息
typedef struct Manager
{
	char id[11];
	char password[7];
	char phone[12];
	char number[20];  //收款账号
}Manager;


//商品信息
typedef struct Shop
{
	char id[11];
    char name[50];
    double price; //价格
    int num;      //数量
    int loss;     //损耗 
}Shop;


//用户信息
typedef struct User
{
	char id[11];
    char password[7];
    char phone[12];
    double vip;
}User;


//后勤人员信息
typedef struct Logistics
{
    char id[11];
    char password[7];
    char phone[12];               
}Logistics;

//日志信息
typedef struct Pay
{
   char pay_phone[12];
   char collection_phone[12];    
   double money;    
   int year;
   int mon;
   int day;
   int hour;
   int min;
   int sec;
}Pay;



typedef struct tm tm;


extern Manager manager;
extern Shop shop[SHOP_MAX];
extern User user[USER_MAX];
extern Logistics logistics[LOGISTICS_MAX];
extern tm *pay_time;
extern Pay pay[TIME_MAX];

extern size_t cnt_shop;
extern size_t cnt_user;
extern size_t cnt_logistics;
extern size_t cnt_time;

#endif//TYPE_H
